<?php
use app\admin\controller\Module;
use app\card\model\UserInfo;
use app\diy\model\DiyModel;
use app\diy\model\MenuModuleModel;
use app\diy\model\ModuleModel;
use app\diy\model\PagePathModel;
use think\facade\Db;

function longbingGetWxAppTabbarResponse($data)
{
	if(empty($data)) return [];
	//数据处理
	$data['list'] = [];
	//处理过的参数
	$menus = [];
	//默认设置
	$data['color'] = '#5d6268';
//	$data['selectedColor'] = '#21bf34';
	$data['selectedColor'] = '#19c865';
	$data['backgroundColor'] = '#fff';
	$data['borderStyle'] = 'white';
	//名片
	if(isset($data['menu1_is_hide']) && !empty($data['menu1_is_hide']))
	{
		$val = [];
		$val['is_show']  = $data['menu1_is_hide'];
		$val['key']      = 1;
		$val['iconPath'] = 'icon-mingpian';
		$val['selectedIconPath'] = 'icon-mingpian1';
		$val['pageComponents']   = 'cardHome';
		if(isset($data['menu1_name'])) $val['name'] = $data['menu1_name'];
		if(isset($data['menu1_url'])) $val['url'] = $data['menu1_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu1_url_out'])) $val['url_out'] = $data['menu1_url_out'];
		if(isset($data['menu1_url_jump_way'])) $val['jump_way'] = $data['menu1_url_jump_way'];
		$data['list'][] = $val;
	}
	//商城
	if(isset($data['menu2_is_hide']) && !empty($data['menu2_is_hide']))
	{
		$val = [];
		$val['key']      = 2;
		$val['is_show']  = $data['menu2_is_hide'];
		$val['iconPath'] = 'icon-shangcheng1';
		$val['selectedIconPath'] = 'icon-shangcheng';
		$val['pageComponents']   = 'shopHome';
		if(isset($data['menu2_name'])) $val['name'] = $data['menu2_name'];
		if(isset($data['menu2_url'])) $val['url'] = $data['menu2_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu2_url_out'])) $val['url_out'] = $data['menu2_url_out'];
		if(isset($data['menu2_url_jump_way'])) $val['url_jump_way'] = $data['menu2_url_jump_way'];
		$data['list'][] = $val;
	}
	//动态
	if(isset($data['menu3_is_hide']) && !empty($data['menu3_is_hide']))
	{
		$val = [];
		$val['key']      = 3;
		$val['is_show']  = $data['menu3_is_hide'];
		$val['iconPath'] = 'icon-dongtai1';
		$val['selectedIconPath'] = 'icon-dongtai';
		$val['pageComponents']   = 'infoHome';
		if(isset($data['menu3_name'])) $val['name'] = $data['menu3_name'];
		if(isset($data['menu3_url'])) $val['url'] = $data['menu3_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu3_url_out'])) $val['url_out'] = $data['menu3_url_out'];
		if(isset($data['menu3_url_jump_way'])) $val['url_jump_way'] = $data['menu3_url_jump_way'];
		$data['list'][] = $val;
	}
	//官网
	if(isset($data['menu4_is_hide']) && !empty($data['menu4_is_hide']))
	{
		$val = [];
		$val['key']      = 4;
		$val['is_show']  = $data['menu4_is_hide'];
		$val['iconPath'] = 'icon-guanwang';
		$val['selectedIconPath'] = 'icon-guanwang1';
		$val['pageComponents']   = 'websiteHome';
		if(isset($data['menu4_name'])) $val['name'] = $data['menu4_name'];
		if(isset($data['menu4_url'])) $val['url'] = $data['menu4_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu4_url_out'])) $val['url_out'] = $data['menu4_url_out'];
		if(isset($data['menu4_url_jump_way'])) $val['url_jump_way'] = $data['menu4_url_jump_way'];
		$data['list'][] = $val;
	}
	//预约
	if(isset($data['menu_appoint_is_hide']) && !empty($data['menu_appoint_is_hide']))
	{
		$val = [];
		$val['key']      = 7;
		$val['is_show']  = $data['menu_appoint_is_hide'];
		$val['iconPath'] = 'icon-yuyue';
		$val['selectedIconPath'] = 'icon-yuyue1';
		$val['pageComponents']   = 'reserveHome';
		if(isset($data['menu_appoint_name'])) $val['name'] = $data['menu_appoint_name'];
		if(isset($data['menu_appoint_url'])) $val['url'] = $data['menu_appoint_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu_appoint_url_out'])) $val['url_out'] = $data['menu_appoint_url_out'];
		if(isset($data['menu_appoint_url_jump_way'])) $val['url_jump_way'] = $data['menu_appoint_url_jump_way'];
		$data['list'][] = $val;
	}
	//活动报名
	if(isset($data['menu_activity_is_show']) && !empty($data['menu_activity_is_show']))
	{
		$val = [];
		$val['key']      = 6;
		$val['is_show']  = $data['menu_activity_is_show'];
		$val['iconPath'] = 'icon-huodong1';
		$val['selectedIconPath'] = 'icon-huodong';
		$val['pageComponents']   = 'avtivityHome';
		if(isset($data['menu_activity_name'])) $val['name'] = $data['menu_activity_name'];
		if(isset($data['menu_activity_url'])) $val['url'] = $data['menu_activity_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu_activity_url_out'])) $val['url_out'] = $data['menu_activity_url_out'];
		if(isset($data['menu_activity_url_jump_way'])) $val['url_jump_way'] = $data['menu_activity_url_jump_way'];
		$data['list'][] = $val;
	}
	//房产
	if(isset($data['menu_house_is_show']) && !empty($data['menu_house_is_show']))
	{
		$val = [];
		$val['key']      = 5;
		$val['is_show']  = $data['menu_house_is_show'];
		$val['iconPath'] = 'icon-fangchan1';
		$val['selectedIconPath'] = 'icon-fangchan';
		$val['pageComponents']   = 'houseHome';
		if(isset($data['menu_house_name']))$val['name'] = $data['menu_house_name'];
		if(isset($data['menu_house_url']))$val['url'] = $data['menu_house_url'];
		$val['url'] = "/pages/user/home";
		if(isset($data['menu_house_url_out']))$val['url_out'] = $data['menu_house_url_out'];
		if(isset($data['menu_house_url_jump_way']))$val['url_jump_way'] = $data['menu_house_url_jump_way'];
		$data['list'][] = $val;
	}


    //自定义  拨打电话   jingshuixian  2019年11月15日14:15:02
    if(TRUE)
    {
        $val = [];
        $val['key']      = 10001;
        $val['is_show']  = 1;
        $val['iconPath'] = 'icon_diy_10001_1';
        $val['selectedIconPath'] = 'icon_diy_10001_1_on';
        $val['pageComponents']   = '';
        $val['name'] = '拨打电话';
        $val['url'] = '';
        $val['url_out'] = '';
        $val['url_jump_way'] = '3';
        $data['list'][] = $val;
    }
    
    //自定义跳转网页    jingshuixian  2019年11月15日14:15:02
    if(TRUE)
    {
        $val = [];
        $val['key']      = 10002;
        $val['is_show']  = 1;
        $val['iconPath'] = 'icon_diy_10002_1';
        $val['selectedIconPath'] = 'icon_diy_10002_1_on';
        $val['pageComponents']   = '';
        $val['name'] = '跳转网页';
        $val['url'] = '';
        $val['url_out'] = '';
        $val['url_jump_way'] = '0';
        $data['list'][] = $val;
    }
    //自定义跳转小程序   jingshuixian  2019年11月15日14:15:02
    if(TRUE)
    {
        $val = [];
        $val['key']      = 10003;
        $val['is_show']  = 1;
        $val['iconPath'] = 'icon_diy_10003_1';
        $val['selectedIconPath'] = 'icon_diy_10003_1_on';
        $val['pageComponents']   = '';
        $val['name'] = '跳转小程序';
        $val['url'] = '';
        $val['url_out'] = '';
        $val['url_jump_way'] = '1';
        $data['list'][] = $val;
    }
    //自定义VR链接   jingshuixian  2019年11月15日14:15:02
    if(TRUE)
    {
        $val = [];
        $val['key']      = 10004;
        $val['is_show']  = 1;
        $val['iconPath'] = 'icon_diy_10004_1';
        $val['selectedIconPath'] = 'icon_diy_10004_1_on';
        $val['pageComponents']   = '';
        $val['name'] = 'VR链接';
        $val['url'] = '';
        $val['url_out'] = '';
        $val['url_jump_way'] = '0';
        $val['addNumber'] = '2';

        $data['list'][] = $val;
    }

    //跳转内部页面
    if(TRUE)
    {
        $val = [];
        $val['key']      = 10005;
        $val['is_show']  = 1;
        $val['iconPath'] = 'icon_diy_10005_1';
        $val['selectedIconPath'] = 'icon_diy_10005_1_on';
        $val['pageComponents']   = '';
        $val['name'] = '跳转内部网页';
        $val['url'] = '';
        $val['url_out'] = '';
        $val['url_jump_way'] = '0';
        $val['addNumber'] = '2';

        $data['list'][] = $val;
    }
//
//	//装修首页
//	if(isset($data['menu_decorate_is_show']) && !empty($data['menu_decorate_is_show']))
//	{
//		$val = [];
//		$val['key']      = 20;
//		$val['is_show']  = $data['menu_decorate_is_show'];
//		$val['iconPath'] = 'iconshouye2';
//		$val['selectedIconPath'] = 'iconshouyexuanzhong';
//		$val['pageComponents']   = 'diyHome';
//		if(isset($data['menu_house_name']))$val['name'] = $data['menu_decorate_name'];
//		if(isset($data['menu_decorate_url']))$val['url'] = $data['menu_decorate_url'];
//		$val['url'] = "/pages/user/home";
//		if(isset($data['menu_decorate_url_out']))$val['url_out'] = $data['menu_decorate_url_out'];
//		if(isset($data['menu_decorate_url_jump_way']))$val['url_jump_way'] = $data['menu_decorate_url_jump_way'];
//		$data['list'][] = $val;
//	}
//
//
//	//工地
//	if(isset($data['menu_jobsite_is_show']) && !empty($data['menu_jobsite_is_show']))
//	{
//		$val = [];
//		$val['key']      = 21;
//		$val['is_show']  = $data['menu_jobsite_is_show'];
//		$val['iconPath'] = 'icongongdiweixuanzhong';
//		$val['selectedIconPath'] = 'icongongdixuanzhong';
//		$val['pageComponents']   = 'siteHome';
//		if(isset($data['menu_jobsite_name']))$val['name'] = $data['menu_jobsite_name'];
//		if(isset($data['menu_jobsite_url']))$val['url'] = $data['menu_jobsite_url'];
//		$val['url'] = "/pages/user/home";
//		if(isset($data['menu_jobsite_url_out']))$val['url_out'] = $data['menu_jobsite_url_out'];
//		if(isset($data['menu_jobsite_url_jump_way']))$val['url_jump_way'] = $data['menu_jobsite_url_jump_way'];
//		$data['list'][] = $val;
//	}


	$menus = ["menu1_name","menu1_is_hide","menu1_url","menu1_url_out","menu1_url_jump_way",
        "menu2_name","menu2_is_hide","menu2_url","menu2_url_out","menu2_url_jump_way",
        "menu3_name","menu3_is_hide","menu3_url","menu3_url_out","menu3_url_jump_way",
        "menu4_name","menu4_is_hide","menu4_url","menu4_url_out","menu4_url_jump_way",
        "menu_appoint_name","menu_appoint_is_hide","menu_appoint_url","menu_appoint_url_out","menu_appoint_url_jump_way",
        "menu_activity_is_show","menu_activity_name","menu_activity_is_hide","menu_activity_url","menu_activity_url_out","menu_activity_url_jump_way",
        "menu_house_is_show","menu_house_name","menu_house_is_hide","menu_house_url","menu_house_url_out","menu_house_url_jump_way",
        "menu_jobsite_is_show","menu_jobsite_name","menu_jobsite_is_hide","menu_jobsite_url","menu_jobsite_url_out","menu_jobsite_url_jump_way",
        "menu_decorate_is_show","menu_decorate_name","menu_decorate_is_hide","menu_decorate_url","menu_decorate_url_out","menu_decorate_url_jump_way",
    ];

	foreach($menus as $menu)
	{
		unset($data[$menu]);
	}
	return $data;
}


function longbingInitDiy ($uniacid)
{
    if (!$uniacid) {
        return false;
    }

    if (DiyModel::where([['uniacid', '=', $uniacid], ['is_system', '=', 1]])->count()) {
        return false;
    }
    $time = time();
    //diy数据
    try {
        $diy_insertData = [
            'diy_name' => '系统默认',
//            'page' => '{"1":{"list":[]},"3":{"list":[]},"6":{"list":[]},"20":{"list":[{"name":"\u8f6e\u64ad\u56fe","id":1573036142604,"type":"banner","style":{"height":350,"whiteSpace":0,"wingBlank":0},"params":{"getType":1},"data":[{"id":1,"advise":"","link":{"title":"","url":"","type":4},"img":[{"id":4,"uniacid":2,"uid":0,"filename":"321.jpg","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8e6f1e0007a11ea9e4e59e123b1d237.jpg","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8e6f1e0007a11ea9e4e59e123b1d237.jpg"}]},{"id":1573036172571,"advise":"","link":{"title":"","url":"","type":4},"img":[{"id":15,"uniacid":2,"uid":0,"filename":"\u56fe-\u62f7\u8d1d.jpg","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/51bb3a90007b11eab129d9b61d745e93.jpg","type":1,"createtime":1573034024,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/51bb3a90007b11eab129d9b61d745e93.jpg"}]}]},{"name":"\u5bfc\u822a","id":1573036179356,"type":"column","style":{"background":"#ffffff","whiteSpace":30,"wingBlank":0},"params":{"getType":1,"row":2,"col":4},"data":[{"id":6,"advise":"","link":{"title":"\u514d\u8d39\u9884\u7ea6","url":"\/renovation\/pages\/design\/design?from=2","type":4},"img":[{"id":18,"uniacid":2,"uid":0,"filename":"\u514d\u8d39\u8bbe\u8ba1.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/ea72c6a2007f11eab30b3b77b5b3cc97.png","type":1,"createtime":1573035998,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/ea72c6a2007f11eab30b3b77b5b3cc97.png"}],"text":"\u514d\u8d39\u8bbe\u8ba1","textColor":"#000000"},{"id":8,"advise":"","link":{"title":"\u667a\u80fd\u62a5\u4ef7","url":"\/renovation\/pages\/offer\/offer?from=2","type":4},"img":[{"id":13,"uniacid":2,"uid":0,"filename":"\u667a\u80fd\u62a5\u4ef7.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f21580007a11eaa2e7f9042e87dc6b.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f21580007a11eaa2e7f9042e87dc6b.png"}],"text":"\u88c5\u4fee\u62a5\u4ef7","textColor":"#000000"},{"id":2,"advise":"","link":{"title":"\u5de5\u5730\u7b5b\u9009\u9875\u9762","url":"\/renovation\/pages\/site\/filter","type":4},"img":[{"id":7,"uniacid":2,"uid":0,"filename":"\u5de5\u5730.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ecbba0007a11ea8ece4ddabcca9ff1.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ecbba0007a11ea8ece4ddabcca9ff1.png"}],"text":"\u5728\u5efa\u5de5\u5730","textColor":"#000000"},{"id":7,"advise":"","link":{"title":"\u6848\u4f8b\u7b5b\u9009\u9875\u9762","url":"\/renovation\/pages\/case\/filter","type":4},"img":[{"id":5,"uniacid":2,"uid":0,"filename":"a\u6848\u4f8b.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ead720007a11ea9abdbb6fb0ec7fcd.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ead720007a11ea9abdbb6fb0ec7fcd.png"}],"text":"\u7cbe\u54c1\u6848\u4f8b","textColor":"#000000"},{"id":5,"advise":"","link":{"title":"\u56e2\u961f\u5217\u8868\u9875\u9762","url":"\/renovation\/pages\/team\/team","type":4},"img":[{"id":12,"uniacid":2,"uid":0,"filename":"\u56e2\u961f.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f11bf0007a11ea82050f89c81f0b94.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f11bf0007a11ea82050f89c81f0b94.png"}],"text":"\u7cbe\u82f1\u56e2\u961f","textColor":"#000000"},{"id":4,"advise":"","link":{"title":"\u6700\u65b0\u6d3b\u52a8","url":"\/activity\/pages\/search?news=1","type":4},"img":[{"id":10,"uniacid":2,"uid":0,"filename":"\u6d3b\u52a8.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ef5c70007a11ea8a6b8b635b63b0ad.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ef5c70007a11ea8a6b8b635b63b0ad.png"}],"text":"\u6700\u65b0\u6d3b\u52a8","textColor":"#000000"},{"id":3,"advise":"","link":{"title":"\u653b\u7565\u7b5b\u9009\u9875\u9762","url":"\/renovation\/pages\/strategy\/list","type":4},"img":[{"id":8,"uniacid":2,"uid":0,"filename":"\u653b\u7565.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8eda120007a11ea9b612d2849ec0ec0.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8eda120007a11ea9b612d2849ec0ec0.png"}],"text":"\u88c5\u4fee\u653b\u7565","textColor":"#000000"},{"id":1,"advise":"","link":{"title":"\u5173\u4e8e\u6211\u4eec","url":"\/renovation\/pages\/about","type":4},"img":[{"id":9,"uniacid":2,"uid":0,"filename":"\u5173\u4e8e.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ee8f30007a11eaa12c65631e8d9f6d.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8ee8f30007a11eaa12c65631e8d9f6d.png"}],"text":"\u5173\u4e8e\u6211\u4eec","textColor":"#000000"}]},{"name":"\u5e7f\u544a","id":1573036220156,"type":"imagewindow","params":{"getType":1,"row":2},"style":{"wingBlank":16,"whiteSpace":16,"backgroundColor":"#fff"},"data":[{"id":1,"advise":"","link":{"title":"\u667a\u80fd\u62a5\u4ef7","url":"\/renovation\/pages\/offer\/offer?from=2","type":4},"img":[{"id":11,"uniacid":2,"uid":0,"filename":"\u514d\u8d39\u8bbe\u8ba1-\u9650\u65f6\u5927\u5e08\u8bbe\u8ba1-\u62f7\u8d1d.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f04010007a11eab78b350ac7a34230.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f04010007a11eab78b350ac7a34230.png"}]},{"id":2,"advise":"","link":{"title":"\u667a\u80fd\u62a5\u4ef7","url":"\/renovation\/pages\/offer\/offer?from=2","type":4},"img":[{"id":14,"uniacid":2,"uid":0,"filename":"\u88c5\u4fee\u62a5\u4ef7-10\u79d2\u51fa\u7ed3\u679c-\u62f7\u8d1d.png","attachment":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f2f670007a11eaad673b420f8cc333.png","type":1,"createtime":1573033767,"module_upload_dir":null,"group_id":null,"displayorder":null,"longbing_attachment_path":"","longbing_driver":"loacl","longbing_from":"","checked":false,"url":"http:\/\/zdl.longbing.org\/attachment\/image\/2\/19\/11\/b8f2f670007a11eaad673b420f8cc333.png"}]}]},{"name":"\u5de5\u5730\u5217\u8868","id":1573036280674,"type":"site","data":[],"params":{"getType":2,"number":5,"sort":0,"title":"\u5728\u5efa\u5de5\u5730"},"style":{"isShowTimeline":false}},{"name":"\u6848\u4f8b\u5217\u8868","id":1573036313402,"type":"case","data":[],"params":{"getType":2,"number":5,"sort":2,"title":"\u7cbe\u54c1\u6848\u4f8b"},"style":[]},{"name":"\u653b\u7565\u5217\u8868","id":1573036316706,"type":"strategy","data":[],"params":{"getType":2,"number":4,"sort":0,"title":"\u88c5\u4fee\u653b\u7565"},"style":[]}]},"21":{"list":[]}}',
//            'tabbar' => '{"id":1,"uniacid":' . $uniacid . ',"status":1,"create_time":1560499627,"update_time":1572320850,"list":[{"key":20,"is_show":1,"iconPath":"iconshouye2","selectedIconPath":"iconshouyexuanzhong","pageComponents":"diyHome","name":"\u9996\u9875","url":"\/pages\/user\/home","url_out":"","url_jump_way":0},{"key":21,"is_show":1,"iconPath":"icongongdiweixuanzhong","selectedIconPath":"icongongdixuanzhong","pageComponents":"siteHome","name":"\u5de5\u5730","url":"\/pages\/user\/home","url_out":"","url_jump_way":0},{"key":3,"is_show":1,"iconPath":"icon-dongtai1","selectedIconPath":"icon-dongtai","pageComponents":"infoHome","name":"\u52a8\u6001","url":"\/pages\/user\/home","url_out":"","url_jump_way":2},{"key":6,"is_show":1,"iconPath":"icon-huodong1","selectedIconPath":"icon-huodong","pageComponents":"avtivityHome","name":"\u6d3b\u52a8","url":"\/pages\/user\/home","url_out":"","url_jump_way":0},{"is_show":1,"key":1,"iconPath":"icon-mingpian","selectedIconPath":"icon-mingpian1","pageComponents":"cardHome","name":"\u540d\u7247","url":"\/pages\/user\/home","url_out":"","jump_way":0}],"color":"#5d6268","selectedColor":"#19c865","backgroundColor":"#fff","borderStyle":"white"}',
            'page'=>'{"1":{"list":[]},"2":{"list":[]},"3":{"list":[]},"4":{"list":[]}}',
            'tabbar'=>'{"id":1,"uniacid":'.$uniacid.',"status":1,"create_time":1573471466,"update_time":1573471466,"list":[{"is_show":1,"key":1,"iconPath":"icon-mingpian","selectedIconPath":"icon-mingpian1","pageComponents":"cardHome","name":"\u540d\u7247","url":"\/pages\/user\/home","url_out":"","jump_way":0},{"key":2,"is_show":1,"iconPath":"icon-shangcheng1","selectedIconPath":"icon-shangcheng","pageComponents":"shopHome","name":"\u5546\u57ce","url":"\/pages\/user\/home","url_out":"","url_jump_way":0},{"key":3,"is_show":1,"iconPath":"icon-dongtai1","selectedIconPath":"icon-dongtai","pageComponents":"infoHome","name":"\u52a8\u6001","url":"\/pages\/user\/home","url_out":"","url_jump_way":0},{"key":4,"is_show":1,"iconPath":"icon-guanwang","selectedIconPath":"icon-guanwang1","pageComponents":"websiteHome","name":"\u5b98\u7f51","url":"\/pages\/user\/home","url_out":"","url_jump_way":0}],"color":"#5d6268","selectedColor":"#19c865","backgroundColor":"#fff","borderStyle":"white"}',
            'status' => 1,
            'uniacid' => $uniacid,
            'create_time' => $time,
            'update_time' => $time,
            'is_system' => 1
        ];
        DiyModel::insert($diy_insertData);
    } catch (\think\exception\PDOException $exception) {
        return false;
    }

    //模块数据
//    try {
//        $module_anli = [
//            'title' => '案例',
//            'description' => '案例',
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid,
//        ];
//        $module_anli_id = ModuleModel::insert($module_anli, true);
//
//
//        $module_gongdi = [
//            'title' => '工地',
//            'description' => '工地',
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid,
//        ];
//        $module_gongdi_id = ModuleModel::insert($module_gongdi, true);
//
//
//        $module_gonglue = [
//            'title' => '攻略',
//            'description' => '攻略',
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid,
//        ];
//        $module_gonglue_id = ModuleModel::insert($module_gonglue, true);
//
//
//        $module_other = [
//            'title' => '其他',
//            'description' => '其他',
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid,
//        ];
//        $module_other_id = ModuleModel::insert($module_other, true);
//
//    } catch (\think\exception\PDOException $exception) {
//        return false;
//    }

    //模块跳转路径数据
//    try {
//        $pagepath_anlixiangqing = [
//            'module_id' => $module_anli_id,
//            'title' => '案例详情页面',
//            'api_path' => '/decorate/AdminCase/diylist',
//            'params' => '{"page" : "PAGE", "page_count" : "PAGE_COUNT"}',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/case/detail',
//        ];
//        PagePathModel::insert($pagepath_anlixiangqing);
//
//
//        $pagepath_gongdixiangqing = [
//            'module_id' => $module_gongdi_id,
//            'title' => '工地详情页面',
//            'api_path' => '/decorate/AdminSite/diylist',
//            'params' => '{"page" : "PAGE", "page_count" : "PAGE_COUNT"}',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/site/detail',
//        ];
//        PagePathModel::insert($pagepath_gongdixiangqing);
//
//
//        $pagepath_gongluexiangqing = [
//            'module_id' => $module_gonglue_id,
//            'title' => '攻略详情页面',
//            'api_path' => '/decorate/AdminNews/diylist',
//            'params' => '{"page" : "PAGE", "page_count" : "PAGE_COUNT"}',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/strategy/detail',
//        ];
//        PagePathModel::insert($pagepath_gongluexiangqing);
//
//
//        $pagepath_zhinengbaojia = [
//            'module_id' => $module_other_id,
//            'title' => '智能报价',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/offer/offer?from=2',
//        ];
//        PagePathModel::insert($pagepath_zhinengbaojia);
//
//
//        $pagepath_mianfeiyuyue = [
//            'module_id' => $module_other_id,
//            'title' => '免费预约',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/design/design?from=2',
//        ];
//        PagePathModel::insert($pagepath_mianfeiyuyue);
//
//        $pagepath_gongdishaixuan = [
//            'module_id' => $module_gongdi_id,
//            'title' => '工地筛选页面',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/site/filter',
//        ];
//        PagePathModel::insert($pagepath_gongdishaixuan);
//
//
//        $pagepath_zuixinhuodong = [
//            'module_id' => $module_other_id,
//            'title' => '最新活动',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/activity/pages/search?news=1',
//        ];
//        PagePathModel::insert($pagepath_zuixinhuodong);
//
//        $pagepath_tuanduileibiao = [
//            'module_id' => $module_other_id,
//            'title' => '团队列表页面',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/team/team',
//        ];
//        PagePathModel::insert($pagepath_tuanduileibiao);
//
//        $pagepath_anlishaixuan = [
//            'module_id' => $module_anli_id,
//            'title' => '案例筛选页面',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/case/filter',
//        ];
//        PagePathModel::insert($pagepath_anlishaixuan);
//
//
//        $pagepath_gonglueshaixuan = [
//            'module_id' => $module_gonglue_id,
//            'title' => '攻略筛选页面',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/strategy/list',
//        ];
//        PagePathModel::insert($pagepath_gonglueshaixuan);
//
//        $pagepath_guanyuwomen = [
//            'module_id' => $module_other_id,
//            'title' => '关于我们',
//            'api_path' => '',
//            'params' => '',
//            'create_time' => $time,
//            'update_time' => $time,
//            'sort' => 1,
//            'status' => 1,
//            'uniacid' => $uniacid,
//            'page' => '/renovation/pages/about',
//        ];
//        PagePathModel::insert($pagepath_guanyuwomen);
//    } catch (\think\exception\PDOException $exception) {
//        return false;
//    }
//
//
//    //菜单与模块的关系表数据
//    $menu_moduel_datas = [
//        [
//            'module_id' => $module_anli_id,
//            'menu_key' => 20,
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid
//        ],
//        [
//            'module_id' => $module_gongdi_id,
//            'menu_key' => 20,
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid
//        ],
//        [
//            'module_id' => $module_gonglue_id,
//            'menu_key' => 20,
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid
//        ],
//        [
//            'module_id' => $module_other_id,
//            'menu_key' => 20,
//            'create_time' => $time,
//            'update_time' => $time,
//            'status' => 1,
//            'uniacid' => $uniacid
//        ],
//    ];
//    try {
//        MenuModuleModel::insertAll($menu_moduel_datas);
//    } catch (\think\db\exception\PDOException $exception) {
//        return false;
//    }

}
